public class Text {
    public static void main(String[] args) {
        Student student1 =new Student("zhangsan",18,99);
        student1.show();
        Student student2=new Student("lisi",16,80);
        student2.show();
        System.out.println(student1);
    }
}
class Student{
    private String name;
    private int age;
    private double score;
    private static String className="113";

    public Student(String name, int age, double score) {
        this.name = name;
        this.age = age;
        this.score = score;
        System.out.println("构造方法被执行了...");
    }
    {
        this.name="wangermazi";
        System.out.println("实例代码块被执行了...");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
    public void goToClass(){
        System.out.println(this.name+"去上课...");
    }
    public void show(){
        System.out.println("姓名："+this.name+" 年龄："+this.age+" 成绩："+this.score+className);
    }
    static{
        className="114";
        System.out.println("静态代码块被执行了...");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }
}
